package cn.design.callback;

/**
 * @author dlq
 * @description
 * @date 2020/9/27 15:01
 * @since 1.0
 */
public class Student {
    private String name;

    public Student(String name) {
        this.name = name;
    }

    public void doWork(Teacher teacher){
        //回调了 Teacher 的 fishWork() 方法 ----就是 学生做完了 然后给老师说我完了作业
        System.out.println("开始做作业了");
        System.out.println("做完了，我要给老师说我做完了");
        teacher.fishWork(name+"已做完作业");
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
